package com.bwie.controller;

import com.bwie.pojo.Order;
import com.bwie.service.ISiteService;
import com.bwie.service.OrderService;
import com.bwie.utils.FreemarkerUtil;
import com.bwie.utils.R;
import freemarker.template.TemplateException;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author : LeiMingkun
 * @date : 2024-09-09 15:04
 * @description : OrderController
 **/
@RestController
@RequestMapping("/order/order")
public class OrderController {
    @Resource
    private OrderService orderService;
    @Resource
    private ISiteService iSiteService;

    @RequestMapping("/getListByNum/{number}")
    public R getListByNum(@PathVariable(name = "number")Integer number){
        return orderService.getListByNum(number);
    }

    @RequestMapping("/insertOrder")
    public R insertOrder(@RequestBody Order order) throws TemplateException, IOException {
        return orderService.insertOrder(order);
    }

    @RequestMapping("/getOrderList")
    public R getOrderList(){
        return orderService.getOrderList();
    }

    @RequestMapping("/updateOrder")
    public R updateOrder(@RequestBody Order order, @RequestHeader String token){
        return orderService.updateOrder(order,token);
    }

    public void Text01(){
        System.out.println("测试01");
    }

}